﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TvTipper.Entities;

namespace TvTipper
{
    public partial class PersonEditForm : Form
    {

        public PersonEditForm()
        {
            InitializeComponent();
        }

        public string PersonName { get; set; }
        public string Description { get; set; }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            m_name.Text = PersonName;
            m_desc.Text = Description;
        }

        private void m_btnOk_Click(object sender, EventArgs e)
        {
            m_error.Clear();

            if (string.IsNullOrEmpty(m_name.Text))
            {
                DialogResult = DialogResult.None;
                m_error.SetError(m_name, "Person name cannot be empty");
                return;
            }

            PersonName = m_name.Text;
            Description = m_desc.Text;
            
        }
    }
}
